****** Table_11_3:  Alternate Measures and Temporal Configurations of European Ancestry
use data/Demo_book_country_4_1600.dta, clear
************ democracy variables

* polyarchy, 100-point scale
gen v2x_polyarchy_100 = (v2x_polyarchy / .924) * 100

* polyarchy, missing obs imputed
impute v2x_polyarchy lexical_index inc_chall_combined , gen(v2x_polyarchy_imp)
* 100-point scale
replace v2x_polyarchy_imp = v2x_polyarchy_imp * 100
gen v2x_polyarchy_imp_100 = (v2x_polyarchy_imp / 92.4) * 100
replace v2x_polyarchy_imp_100 = . if sovereign_Cojocaru ==.


*1) Benchmark measure of Europe
qui reg v2x_polyarchy_imp_100 eur_pct_est_smooth predallports53_100km lp_lat_abst i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(eur_pct_est_smooth) replace
qui drop sample

*2) Narrow measure of Europe (Latin or Germanic language)
qui reg v2x_polyarchy_imp_100 eur_pct_est_smooth_orig predallports53_100km lp_lat_abst i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(eur_pct_est_smooth_orig) append
qui drop sample

*3) Quadratic: not robust when Europe excluded
qui reg v2x_polyarchy_imp_100 c.eur_pct_est_smooth##c.eur_pct_est_smooth predallports53_100km lp_lat_abst i.year if europe_harbors_def == 0, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(c.eur_pct_est_smooth##c.eur_pct_est_smooth) replace
qui drop sample

*4) 100-year lag
qui reg v2x_polyarchy_imp_100 l100.eur_pct_est_smooth predallports53_100km lp_lat_abst i.year , vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(l100.eur_pct_est_smooth) append
qui drop sample

*5) 200-year lag
qui reg v2x_polyarchy_imp_100 l200.eur_pct_est_smooth predallports53_100km lp_lat_abst i.year , vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(l200.eur_pct_est_smooth) append
qui drop sample

*6) Y measured in 2000, left-side vars measured in 1900
qui reg v2x_polyarchy_imp_100 l100.eur_pct_est_smooth predallports53_100km lp_lat_abst if year == 2000, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(l100.eur_pct_est_smooth) append
qui drop sample

*7) Stock measure (back to 1600 with 10% annual depreciation)
qui reg v2x_polyarchy_imp_100 eur_pct_est_smooth_stock_1600_10 predallports53_100km lp_lat_abst i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(eur_pct_est_smooth_stock_1600_10) append
qui drop sample

** fixed effects

*8) benchmark
qui xtreg v2x_polyarchy_imp_100 L10.eur_pct_est_smooth i.year,fe vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(L10.eur_pct_est_smooth) append
qui drop sample

*9) year < 2000
qui xtreg v2x_polyarchy_imp_100 L10.eur_pct_est_smooth i.year if year < 2000,fe vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_11_3.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(L10.eur_pct_est_smooth) replace
qui drop sample
